function square(x) {return x * x;};

var a = square(4);
var b = square;
var c = b(5);

var o = new Object;
o.square = new Function("x", "return x * x");
y = o.square(16);

var a = new Array(3);
a[0] = function(x) {return x * x;};
a[1] = 20;
a[2] = a[0](a[1]);

function add(x, y) {return x + y;}
function substract(x, y) {return x - y;}
function multiply(x, y) {return x * y;}
function divide(x, y) {return x / y;}

function operate(operator, operand1, operand2) {
	return operator(operand1, operand2);
}

var i = operate(add, operate(add, 2, 3), operate(multiply, 4, 5));

var operators = new Object();
operators["add"] = function(x, y) {return x + y;};
operators["substract"] = function(x, y) {return x - y;};
operators["multiply"] = function(x, y) {return x * y;};
operators["divide"] = function(x, y) {return x / y;};
operator2["pow"] = Math.pow;

function operate2(op_name, operand1, operand2) {
	if(operators[op_name] == null) 
		return "Unkown operator";
	else
		return operators[op_name](operand1, operand2);
}

var j = operate2("add", "hello", operate2("add", " ", "world"));
var k = operate2("pow", 10, 2);